package net.jlibrary.student.action.vo;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import net.jlibrary.common.CoreConstants;
import net.jlibrary.common.core.annotation.VoForPo;
import net.jlibrary.common.core.entity.BaseVo;
import net.jlibrary.student.domain.Specialty;
import net.jlibrary.student.domain.Student;

@VoForPo(Student.class)
public class StudentVo extends BaseVo {

	private static final long serialVersionUID = 4964787706703021956L;
	private Long id;
	private String name;
	private Integer age;
	private Integer sex;
	private String fromSex;

	public String getFromSex() {
		return fromSex;
	}

	public void setFromSex(String fromSex) {
		this.fromSex = fromSex;
	}

	private SpecialtyVo specialtySearchKey;

	public StudentVo() {
		specialty = new SpecialtyVo();
		specialtySearchKey = new SpecialtyVo();
	}

	private SpecialtyVo specialty;

	public SpecialtyVo getSpecialty() {
		return specialty;
	}

	public void setSpecialty(SpecialtyVo specialty) {
		this.specialty = specialty;
	}

	private Integer specialty_id;

	public Integer getSpecialty_id() {
		return specialty_id;
	}

	public void setSpecialty_id(Integer specialty_id) {
		this.specialty_id = specialty_id;
	}

	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date createdate;
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date lastdate;

	private String nameSearchKey;

	public SpecialtyVo getSpecialtySearchKey() {
		return specialtySearchKey;
	}

	public void setSpecialtySearchKey(SpecialtyVo specialtySearchKey) {
		this.specialtySearchKey = specialtySearchKey;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	/*
	 * public SpecialtyVo getSpecialty() { return specialty; }
	 * 
	 * public void setSpecialty(SpecialtyVo specialty) { this.specialty = specialty;
	 * }
	 */

	@Override
	public Serializable getPrimaryKey() {
		return id;
	}

	@Override
	public Serializable getText() {
		return name;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	public Date getLastdate() {
		return lastdate;
	}

	public void setLastdate(Date lastdate) {
		this.lastdate = lastdate;
	}

	public String getNameSearchKey() {
		return nameSearchKey;
	}

	public void setNameSearchKey(String nameSearchKey) {
		this.nameSearchKey = nameSearchKey;
	}

	@VoForPo(Specialty.class)
	public class SpecialtyVo extends BaseVo {
		private static final long serialVersionUID = -7779570351075723931L;
		private Long id;
		private String name;
		private String code;
		private boolean valid;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		@Override
		public Serializable getPrimaryKey() {
			return id;
		}

		@Override
		public Serializable getText() {
			return name;
		}

		@Override
		public Date getCreatedate() {
			return createdate;
		}

		@Override
		public Date getLastdate() {
			return lastdate;
		}

		@Override
		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		@Override
		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}

		public Long getId() {
			return id;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public boolean isValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		private String codeSearchKey;

		public String getCodeSearchKey() {
			return codeSearchKey;
		}

		public void setCodeSearchKey(String codeSearchKey) {
			this.codeSearchKey = codeSearchKey;
		}

	}

	/*
	 * public SpecialtyVo getSpecialtyVoSearchKey() { return specialtyVoSearchKey; }
	 * 
	 * public void setSpecialtyVoSearchKey(SpecialtyVo specialtyVoSearchKey) {
	 * this.specialtyVoSearchKey = specialtyVoSearchKey; }
	 */

	/*
	 * public SpecialtyVo getSpecialtySearchKey() { return specialtySearchKey; }
	 * 
	 * public void setSpecialtySearchKey(SpecialtyVo specialtySearchKey) {
	 * this.specialtySearchKey = specialtySearchKey; }
	 */
}
